/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.foridev.gec.gui;

import com.foridev.gec.model.Acte;
import com.foridev.gec.dao.ActeDao;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.CheckBox;
import javafx.scene.control.SplitPane;
import javafx.scene.control.TitledPane;

/**
 * FXML Controller class
 *
 * @author SABRI AHMED
 */
public class FindPeopleController implements Initializable {

    @FXML private TitledPane tpCritaireRech;
    @FXML private CheckBox cbxRechAvanc;
    @FXML private SplitPane spx;
    /**
     * Initializes the controller class.
     */
    @Override
    public void initialize(URL url, ResourceBundle rb) {
        // TODO
        ActeDao ad = new ActeDao();
        Acte a = new Acte("0333", null, Integer.MIN_VALUE, null, "EL MRABET", "MOHAMMED AMINE", null, null, null, null, null, null, null, null, null, null, null, null, null, null);
        ad.persist(a);
        for(Acte ac : ad.getActesWithFilters())
            System.out.println(a.getNomAr() + " *************** "+a.getPrenomAr());
        
    }    
    @FXML protected void processAdvencedSearch(){
        if(cbxRechAvanc.isSelected())
        {
            tpCritaireRech.setDisable(false);
            tpCritaireRech.setExpanded(true);
        }
        else
        {
            tpCritaireRech.setDisable(true);
            tpCritaireRech.setExpanded(false);
        }
        
    }
}
